import { createRouter, createWebHistory } from 'vue-router'
import index from '../pages/layout/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: index,
      children: [
        {
          path: '/',
          name: 'zhuye',
          component: () => import('../pages/layout/layout.vue')
        },
        {
          path: '/xiaoshou',
          name: 'xiaoshou',
          component: () => import('../pages/xiaoshou/index.vue')
        },
        {
          path: '/shangpin',
          name: 'shangpin',
          component: () => import('../pages/shangpin/index.vue')
        },
        {
          path: '/wode',
          name: 'wode',
          component: () => import('../pages/wode/index.vue'),
        },
      ]
    },
    {
      path: '/shangpin/clickimg',
      name: 'clickimg',
      component: () => import('../pages/shangpin/clickimg.vue')
    },
    {
      path: '/shangpin/zizhi',
      name: 'zizhi',
      component: () => import('../pages/shangpin/zizhi.vue')
    },
    {
      path: '/shangpin/addType',
      name: 'addType',
      component: () => import('../pages/shangpin/addType.vue')
    },
    {
      path: '/shangpin/updateType',
      name: 'updateType',
      component: () => import('../pages/shangpin/updateType.vue')
    },
    {
      path: '/shangpin/updateGoodsInfo',
      name: 'updateGoodsInfo',
      component: () => import('../pages/shangpin/updateGoodsInfo.vue')
    },
    {
      path: '/shangpin/addGoods',
      name: 'addGoods',
      component: () => import('../pages/shangpin/addGoods.vue')
    },
    {
      path: '/mendian',
      name: 'mendian',
      component: () => import('../pages/wode/mendian.vue')
    },
    {
      path: '/zhanghao',
      name: 'zhanghao',
      component: () => import('../pages/wode/zhanghao.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../pages/login/login.vue')
    },
    {
      path: '/:pathMatch(.*)*',
      name: '404',
      component: () => import('../pages/404.vue')
    },
  ]
})

export default router
